/**
 */
package com.dingpeikeji.quickdeer.core.modules.orders.entity;

import java.util.Date;

import org.hibernate.validator.constraints.Length;

import com.dingpeikeji.quickdeer.core.common.persistence.DataEntity;
import com.dingpeikeji.quickdeer.core.common.utils.excel.annotation.ExcelField;
import com.dingpeikeji.quickdeer.core.modules.payinfo.entity.TPayinfo;
import com.dingpeikeji.quickdeer.core.modules.realsche.entity.TRealsche;
import com.dingpeikeji.quickdeer.core.modules.realsche.entity.TRealscheBoard;
import com.dingpeikeji.quickdeer.core.modules.realsche.entity.TRealscheOff;
import com.dingpeikeji.quickdeer.core.modules.sys.entity.Office;
import com.dingpeikeji.quickdeer.modules.rcpt.entity.TRcpt;
import com.dingpeikeji.quickdeer.modules.rentproduct.entity.TCargotype;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;

/**
 * 用户订单管理Entity
 * 
 * @author lh
 * @version 2016-06-15
 */
public class TOrders extends DataEntity<TOrders> {

	// 订单状态的取值
	public static final String STATUS_PAY = "0"; // 已支付
	public static final String STATUS_OFFLINE = "4"; // 线下订单
	public static final String STATUS_NO_PAY = "1"; // 未支付
	public static final String STATUS_BACK = "2"; // 已取消
	public static final String STATUS_CANCEL = "9"; // 已作废

	public static final String ORDER_TYPE_REALSCHE_SELF_TRAVEL = "1"; // 顺风车
	public static final String ORDER_TYPE_RENTPRODUCT_DAY = "2"; // 按天包车
	public static final String ORDER_TYPE_RENTPRODUCT_TRAVEL = "5"; // 旅游包车
	public static final String ORDER_TYPE_RENTPRODUCT_AIRPLANE = "6"; // 接送机包车
	public static final String ORDER_TYPE_RENTPRODUCT_TRAIN = "a"; // 接送火车包车
	public static final String ORDER_TYPE_RENTPRODUCT_CUSTOM = "c"; // 定制包车
	public static final String ORDER_TYPE_GUWEN = "9"; // 行程顾问
	public static final String ORDER_TYPE_TRAVEL_SHARE = "3"; // AA拼车(旅游包车)
	public static final String ORDER_TYPE_AIR_SHARE = "4"; // AA拼车(接送机)

	public static final String SETTLE_REASON_SYSCANCEL = "0"; // 系统自动作废
	public static final String SETTLE_REASON_USERCANCEL = "1"; // 用户作废
	public static final String SETTLE_REASON_FLATBACK = "2"; // 平台退单
	public static final String SETTLE_REASON_BUSBACK = "3"; // 车队退单
	public static final String SETTLE_REASON_USERBACK = "4"; // 用户退单
	public static final String SETTLE_REASON_CHGBUS = "5"; // 更换车队
	public static final String SETTLE_REASON_BREAK = "6"; // 车队违约

	// 支付方式的取值
	public static final String PAY_WAY_OFFLINE = "1"; // 线下结算
	public static final String PAY_WAY_ALIPAY = "2"; // 支付宝
	public static final String PAY_WAY_WXPAY = "3"; // 微信支付
	public static final String PAY_WAY_CREDIT = "4"; // 授信支付
	public static final String PAY_WAY_OTHERS = "9"; // 其他

	// 整车的套餐类型
	public static final String BOOKING_TYPE_TWO = "1"; // 往返
	public static final String BOOKING_TYPE_ONE = "2"; // 单程
	public static final String BOOKING_TYPE_NOT_FIRST_SHARE = "3"; // 不是第一次生成拼车订单

	private static final long serialVersionUID = 1L;
	private String orderid; // 主键
	@JsonIgnore
	private TPayinfo payinfo; // 支付单表
	private String ordername; // 订单名称
	private String realscheid; // 班次id
	private TRealsche realsche; // 排班信息
	private String realboardid; // 上客点ID
	private String ordertype; // 订单类型
	private String realoffid; // 下客点ID
	private String boardaddr; // 上车地点
	private String detailAddress; // 具体上车地点
	private String offaddr; // 下车地点
	private Date departdate; // 出发日期
	private String purchasenum; // 购票数量
	private String childnum; // 儿童数量
	private String dueamount; // 应付金额
	private String totalamount; // 订单总金额(拼车)
	private String remarks; // 行程备注
	private String orderRemarks; // 订单备注
	private String ischeck; // 完单标志
	private Date checkdate; // 完单时间
	private Office office; // 订单归属公司
	private String orderstatus; // 订单状态
	private String orderuserid; // 订票人
	private Office useroffice; // 订票人所在公司
	private String payerid; // 支付人
	private String contacts; // 联系人
	private Date paydate; // 支付时间
	private String payertel; // 手机号
	private String sfzCode; // 身份证
	private String payway; // 支付方式
	private String paymentid; // 支付id
	private String canceluser; // 取消订票人
	private Date canceldate; // 取消时间
	private String discount; // 优惠方式
	private String bookingtype; // 整车套餐类型
	private Integer bookingdays;// 预定天数
	private TRealscheBoard realscheBoard;
	private TRealscheOff realscheOff;
	private String confirmid;
	private Date confirmdate;
	private String settlereason;
	private Double priceup;
	private TCargotype cartype;
	private TRcpt rcpt;
	private String istrouble;
	private String reason;
	private String offermount; // 车队报价
	private Double settlemoney;
	// 扩展字段
	private String activityId;// 活动id
	private String activityRemark;// 活动备注
	private Integer paycount;
	private String departcity; // 出发地城市
	private String destcity; // 目的地地市
	private String createDateQueryStart; // 创建日期查询起始
	private String createDateQueryEnd; // 创建日期查询终止
	private String payDateQueryStart; // 支付日期查询起始
	private String payDateQueryEnd; // 支付日期查询终止

	private String departdateStr; // 出发日期字符串
	private String genRcpt; // 1表示已开发票，0表示未开发票

	private String fromdateStr; // 出发日期
	private String time; // 出发时间
	private String personCount; // 拼车人数
	private String shareid; // 拼车产品id

	private String warnstatus; // 警示状态！
	private Double penalty;// 违约金
	private Integer cargotypeid;
	private String officeids;
	private String isBalance;// 分销是否结算
	private String tripId;// 行程顾问id
	private String useCupons;// 是否使用优惠券 0未使用 1已使用
	private String cuponsPrice;// 优惠券优惠金额

	// 线下订单
	private String clientname;// 客户名称
	private String merchandiser;// 业务员
	private String roadfees;// 路杂费 0否 1是
	private String oil;// 含油 0否 1是
	private String tax;// 含税 0否 1是
	private String driverlodge;// 驾驶员住宿 0否 1是
	
	private String endtime;
	private Double nowpay;//现收
	private Double downpay;//定金
	private Double ownpay;//挂账
	
	private String settlement;//是否结算 0否1是
	private Double deductions;//扣款金额
	private String dedreason;//扣款原因
	
	public Double getDeductions() {
		return deductions;
	}

	public void setDeductions(Double deductions) {
		this.deductions = deductions;
	}

	public String getDedreason() {
		return dedreason;
	}

	public void setDedreason(String dedreason) {
		this.dedreason = dedreason;
	}

	public String getSettlement() {
		return settlement;
	}

	public void setSettlement(String settlement) {
		this.settlement = settlement;
	}

	public Double getNowpay() {
		return nowpay;
	}

	public void setNowpay(Double nowpay) {
		this.nowpay = nowpay;
	}

	public Double getDownpay() {
		return downpay;
	}

	public void setDownpay(Double downpay) {
		this.downpay = downpay;
	}

	public Double getOwnpay() {
		return ownpay;
	}

	public void setOwnpay(Double ownpay) {
		this.ownpay = ownpay;
	}

	public String getEndtime() {
		return endtime;
	}

	public void setEndtime(String endtime) {
		this.endtime = endtime;
	}

	public String getClientname() {
		return clientname;
	}

	public void setClientname(String clientname) {
		this.clientname = clientname;
	}

	public String getMerchandiser() {
		return merchandiser;
	}

	public void setMerchandiser(String merchandiser) {
		this.merchandiser = merchandiser;
	}

	public String getRoadfees() {
		return roadfees;
	}

	public void setRoadfees(String roadfees) {
		this.roadfees = roadfees;
	}

	public String getOil() {
		return oil;
	}

	public void setOil(String oil) {
		this.oil = oil;
	}

	public String getTax() {
		return tax;
	}

	public void setTax(String tax) {
		this.tax = tax;
	}

	public String getDriverlodge() {
		return driverlodge;
	}

	public void setDriverlodge(String driverlodge) {
		this.driverlodge = driverlodge;
	}

	public String getUseCupons() {
		return useCupons;
	}

	public String getCuponsPrice() {
		return cuponsPrice;
	}

	public void setCuponsPrice(String cuponsPrice) {
		this.cuponsPrice = cuponsPrice;
	}

	public void setUseCupons(String useCupons) {
		this.useCupons = useCupons;
	}

	public String getActivityId() {
		return activityId;
	}

	public void setActivityId(String activityId) {
		this.activityId = activityId;
	}

	public Integer getPaycount() {
		return paycount;
	}

	public void setPaycount(Integer paycount) {
		this.paycount = paycount;
	}

	public String getActivityRemark() {
		return activityRemark;
	}

	public void setActivityRemark(String activityRemark) {
		this.activityRemark = activityRemark;
	}

	public String getShareid() {
		return shareid;
	}

	public void setShareid(String shareid) {
		this.shareid = shareid;
	}

	public String getPersonCount() {
		return personCount;
	}

	public void setPersonCount(String personCount) {
		this.personCount = personCount;
	}

	public String getIsBalance() {
		return isBalance;
	}

	public void setIsBalance(String isBalance) {
		this.isBalance = isBalance;
	}

	public String getTripId() {
		return tripId;
	}

	public void setTripId(String tripId) {
		this.tripId = tripId;
	}

	public TOrders() {
		super();
	}

	public Integer getCargotypeid() {
		return cargotypeid;
	}

	public void setCargotypeid(Integer cargotypeid) {
		this.cargotypeid = cargotypeid;
	}

	public String getOfficeids() {
		return officeids;
	}

	public void setOfficeids(String officeids) {
		this.officeids = officeids;
	}

	public TOrders(String id) {
		super(id);
	}

	@ExcelField(title = "订单号", type = 1, align = 2, sort = 1)
	public String getOrderid() {
		return orderid;
	}

	public void setOrderid(String orderid) {
		this.orderid = orderid;
	}

	public TPayinfo getPayinfo() {
		return payinfo;
	}

	public void setPayinfo(TPayinfo payinfo) {
		this.payinfo = payinfo;
	}

	public String getRealscheid() {
		return realscheid;
	}

	public void setRealscheid(String realscheid) {
		this.realscheid = realscheid;
	}

	@ExcelField(title = "辆数", align = 2, sort = 50)
	public String getPurchasenum() {
		return purchasenum;
	}

	public void setPurchasenum(String purchasenum) {
		this.purchasenum = purchasenum;
	}

	public String getChildnum() {
		return childnum;
	}

	public void setChildnum(String childnum) {
		this.childnum = childnum;
	}

	@ExcelField(title = "金额", align = 2, sort = 55)
	public String getDueamount() {
		return dueamount;
	}

	public void setDueamount(String dueamount) {
		this.dueamount = dueamount;
	}

	@Length(min = 1, max = 1, message = "订单状态长度必须介于 1 和 1 之间")
	@ExcelField(title = "订单状态", align = 2, sort = 60, dictType = "orderstatus")
	public String getOrderstatus() {
		return orderstatus;
	}

	public void setOrderstatus(String orderstatus) {
		this.orderstatus = orderstatus;
	}

	@Length(min = 0, max = 64, message = "订票人长度必须介于 0 和 64 之间")
	public String getOrderuserid() {
		return orderuserid;
	}

	public void setOrderuserid(String orderuserid) {
		this.orderuserid = orderuserid;
	}

	@Length(min = 0, max = 64, message = "支付人长度必须介于 0 和 64 之间")
	public String getPayerid() {
		return payerid;
	}

	public void setPayerid(String payerid) {
		this.payerid = payerid;
	}

	@Length(min = 1, max = 50, message = "联系人长度必须介于 1 和 50 之间")
	public String getContacts() {
		return contacts;
	}

	public void setContacts(String contacts) {
		this.contacts = contacts;
	}

	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	public Date getPaydate() {
		return paydate;
	}

	public void setPaydate(Date paydate) {
		this.paydate = paydate;
	}

	@Length(min = 0, max = 11, message = "手机号长度必须介于 0 和 11 之间")
	public String getPayertel() {
		return payertel;
	}

	public void setPayertel(String payertel) {
		this.payertel = payertel;
	}

	@Length(min = 0, max = 1, message = "支付方式长度必须介于 0 和 1 之间")
	public String getPayway() {
		return payway;
	}

	public void setPayway(String payway) {
		this.payway = payway;
	}

	@Length(min = 0, max = 32, message = "支付id长度必须介于 0 和 32 之间")
	public String getPaymentid() {
		return paymentid;
	}

	public void setPaymentid(String paymentid) {
		this.paymentid = paymentid;
	}

	public String getCanceluser() {
		return canceluser;
	}

	public void setCanceluser(String canceluser) {
		this.canceluser = canceluser;
	}

	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	public Date getCanceldate() {
		return canceldate;
	}

	public void setCanceldate(Date canceldate) {
		this.canceldate = canceldate;
	}

	@Length(min = 0, max = 1, message = "优惠方式长度必须介于 0 和 1 之间")
	public String getDiscount() {
		return discount;
	}

	public void setDiscount(String discount) {
		this.discount = discount;
	}

	public String getDepartcity() {
		return departcity;
	}

	public void setDepartcity(String departcity) {
		this.departcity = departcity;
	}

	public String getDestcity() {
		return destcity;
	}

	public void setDestcity(String destcity) {
		this.destcity = destcity;
	}

	public String getCreateDateQueryStart() {
		return createDateQueryStart;
	}

	public void setCreateDateQueryStart(String createDateQueryStart) {
		this.createDateQueryStart = createDateQueryStart;
	}

	public String getCreateDateQueryEnd() {
		return createDateQueryEnd;
	}

	public void setCreateDateQueryEnd(String createDateQueryEnd) {
		this.createDateQueryEnd = createDateQueryEnd;
	}

	public String getRealboardid() {
		return realboardid;
	}

	public void setRealboardid(String realboardid) {
		this.realboardid = realboardid;
	}

	public String getRealoffid() {
		return realoffid;
	}

	public void setRealoffid(String realoffid) {
		this.realoffid = realoffid;
	}

	public String getOrdertype() {
		return ordertype;
	}

	public void setOrdertype(String ordertype) {
		this.ordertype = ordertype;
	}

	public String getBoardaddr() {
		return boardaddr;
	}

	public void setBoardaddr(String boardaddr) {
		this.boardaddr = boardaddr;
	}

	public String getOffaddr() {
		return offaddr;
	}

	public void setOffaddr(String offaddr) {
		this.offaddr = offaddr;
	}

	@ExcelField(title = "发车日期", align = 2, sort = 30)
	public Date getDepartdate() {
		return departdate;
	}

	public void setDepartdate(Date departdate) {
		this.departdate = departdate;
	}

	public String getRemarks() {
		return remarks;
	}

	public void setRemarks(String remarks) {
		this.remarks = remarks;
	}

	public String getIscheck() {
		return ischeck;
	}

	public void setIscheck(String ischeck) {
		this.ischeck = ischeck;
	}

	@ExcelField(value = "office.name", title = "车队", align = 2, sort = 80)
	public Office getOffice() {
		return office;
	}

	public void setOffice(Office office) {
		this.office = office;
	}

	public String getBookingtype() {
		return bookingtype;
	}

	public void setBookingtype(String bookingtype) {
		this.bookingtype = bookingtype;
	}

	public Integer getBookingdays() {
		return bookingdays;
	}

	public void setBookingdays(Integer bookingdays) {
		this.bookingdays = bookingdays;
	}

	public String getPayDateQueryStart() {
		return payDateQueryStart;
	}

	public void setPayDateQueryStart(String payDateQueryStart) {
		this.payDateQueryStart = payDateQueryStart;
	}

	public String getPayDateQueryEnd() {
		return payDateQueryEnd;
	}

	public void setPayDateQueryEnd(String payDateQueryEnd) {
		this.payDateQueryEnd = payDateQueryEnd;
	}

	public String getDepartdateStr() {
		return departdateStr;
	}

	public void setDepartdateStr(String departdateStr) {
		this.departdateStr = departdateStr;
	}

	public TRealscheBoard getRealscheBoard() {
		return realscheBoard;
	}

	public void setRealscheBoard(TRealscheBoard realscheBoard) {
		this.realscheBoard = realscheBoard;
	}

	public TRealscheOff getRealscheOff() {
		return realscheOff;
	}

	public void setRealscheOff(TRealscheOff realscheOff) {
		this.realscheOff = realscheOff;
	}

	@ExcelField(title = "订单名称", align = 2, sort = 20)
	public String getOrdername() {
		return ordername;
	}

	public void setOrdername(String ordername) {
		this.ordername = ordername;
	}

	public String getConfirmid() {
		return confirmid;
	}

	public void setConfirmid(String confirmid) {
		this.confirmid = confirmid;
	}

	public Date getConfirmdate() {
		return confirmdate;
	}

	public void setConfirmdate(Date confirmdate) {
		this.confirmdate = confirmdate;
	}

	@JsonIgnore
	@ExcelField(value = "cartype.typename", title = "车型", align = 2, sort = 40)
	public TCargotype getCartype() {
		return cartype;
	}

	public void setCartype(TCargotype cartype) {
		this.cartype = cartype;
	}

	public TRcpt getRcpt() {
		return rcpt;
	}

	public String getSfzCode() {
		return sfzCode;
	}

	public void setSfzCode(String sfzCode) {
		this.sfzCode = sfzCode;
	}

	public void setRcpt(TRcpt rcpt) {
		this.rcpt = rcpt;
	}

	public String getGenRcpt() {
		return genRcpt;
	}

	public void setGenRcpt(String genRcpt) {
		this.genRcpt = genRcpt;
	}

	@ExcelField(title = "处理原因", align = 2, sort = 70, dictType = "settlereason")
	public String getSettlereason() {
		return settlereason;
	}

	public void setSettlereason(String settlereason) {
		this.settlereason = settlereason;
	}


	public Double getPriceup() {
		return priceup;
	}

	public void setPriceup(Double priceup) {
		this.priceup = priceup;
	}

	public String getFromdateStr() {
		return fromdateStr;
	}

	public void setFromdateStr(String fromdateStr) {
		this.fromdateStr = fromdateStr;
	}

	public String getTime() {
		return time;
	}

	public void setTime(String time) {
		this.time = time;
	}

	@ExcelField(value = "realsche.dispstatus", title = "调度状态", align = 2, sort = 85, dictType = "dispatch")
	public TRealsche getRealsche() {
		return realsche;
	}

	public void setRealsche(TRealsche realsche) {
		this.realsche = realsche;
	}

	public String getIstrouble() {
		return istrouble;
	}

	public void setIstrouble(String istrouble) {
		this.istrouble = istrouble;
	}

	public String getReason() {
		return reason;
	}

	public void setReason(String reason) {
		this.reason = reason;
	}

	public Date getCheckdate() {
		return checkdate;
	}

	public void setCheckdate(Date checkdate) {
		this.checkdate = checkdate;
	}

	@ExcelField(title = "订单时间", type = 0, align = 1, sort = 25)
	public Date getCreateDate() {
		return createDate;
	}

	public String getWarnstatus() {
		return warnstatus;
	}

	public void setWarnstatus(String warnstatus) {
		this.warnstatus = warnstatus;
	}

	public Double getSettlemoney() {
		return settlemoney;
	}

	public void setSettlemoney(Double settlemoney) {
		this.settlemoney = settlemoney;
	}

	public void setDetailAddress(String detailAddress) {
		this.detailAddress = detailAddress;
	}

	public String getOrderRemarks() {
		return orderRemarks;
	}

	public void setOrderRemarks(String orderRemarks) {
		this.orderRemarks = orderRemarks;
	}

	public String getOffermount() {
		return offermount;
	}

	public void setOffermount(String offermount) {
		this.offermount = offermount;
	}

	public Double getPenalty() {
		return penalty;
	}

	public void setPenalty(Double penalty) {
		this.penalty = penalty;
	}

	public void setSettlemoney(double settlemoney) {
		this.settlemoney = settlemoney;
	}

	public Office getUseroffice() {
		return useroffice;
	}

	public String getTotalamount() {
		return totalamount;
	}

	public void setTotalamount(String totalamount) {
		this.totalamount = totalamount;
	}

	public void setUseroffice(Office useroffice) {
		this.useroffice = useroffice;
	}

}